<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="utf-8">
    <title>日志表--CRM客户关系管理系统</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="resources/layui/css/layui.css" media="all" />
    <link rel="stylesheet" href="resources/css/public.css" media="all" />
</head>
<style>
    .imexcel{
        float: right;
    }
</style>

<body class="childrenBody">

    <!--导出excel按钮-->
    <script type="text/html" id="data-toolbar">
        <div class="layui-btn-container">
            <button class="layui-btn layui-btn-sm" lay-event="export" id="exportFile">Excel导出</button>
        </div>
    </script>

    <table id="sysLogsList" lay-filter="sysLogsList"></table>
    <!--操作-->
    <script type="text/html" id="sysLogsListBar">
        <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
        <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
        <a class="layui-btn layui-btn-xs layui-btn-primary" lay-event="look">查看</a>
        <a class="layui-btn layui-btn-xs layui-btn-warm" lay-event="assignRight">分配权限</a>
    </script>
    <script type="text/javascript" src="resources/layui/layui.js"></script>
    <script type="text/javascript" src="resources/layui/layui_exts/excel.js"></script>
<script type="text/javascript" th:inline="none">
    layui.use(['form','layer','table','laytpl'],function(){
        var form = layui.form,
            layer = parent.layer === undefined ? layui.layer : top.layer,
            $ = layui.jquery,
            laytpl = layui.laytpl,
            table = layui.table;
        //用户列表
        var tableIns = table.render({
            elem: '#sysLogsList',
            url : 'sysLogs.do',
            cellMinWidth : 95,
            page : true,
            height : "full-125",
            limits : [10,15,20,25],
            limit : 20,
            id : "sysLogsListTable",
            toolbar: "#data-toolbar",
            defaultToolbar: ['filter', 'print', 'exports'],
            totalRow: true,
            title: '数据表',
            cols : [[
                {type: "checkbox", fixed:"left", width:50},
                {field: 'id', title: '编号', minWidth:100, align:"center"},
                {field: 'username', title: '用户名', align:'center'},
                {field: 'operation', title: '操作', align:'center'},
                {field: 'createDate', title: '操作时间', align:'center'},
                {field: 'method', title: '方法名', align:'center'},
                {field: 'ip', title: 'ip地址', align:'center'},
                {field: 'params', title: '参数', align:'center'},


            ]]
        });

        /*导出数据*/
        $('#exportFile').on('click',function () {
            console.info("export");
            $.ajax({
                url: "sysLogs.do",
                type: 'get',
                async: false,
                dataType: 'json',
                success: function (res) {
                    LAY_EXCEL.exportExcel(res.data, 'data.xlsx', 'xlsx')
                }
            });
        });


    });
</script>
</body>
</html>